﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Dln.Common.Helper;
using Dln.Model;

public partial class Page_Community_TopicDetial : System.Web.UI.Page
{
    protected Community_Topic topicModel = new Community_Topic();
    protected IList<Community_TopicReply> topicReplyList = null;
    protected int topicId = 0;
    protected string openid = string.Empty;
    protected void Page_Load(object sender, EventArgs e)
    {
        topicId = Convert.ToInt32(HttpContext.Current.Request.QueryString["topicId"]);
        openid = HttpContext.Current.Request.QueryString["openid"];


        topicModel = SqlHelper.Context.From<Community_Topic>().Where(m => m.Id == topicId).ToFirst();
        var topicReply = SqlHelper.Context.From<Community_TopicReply>().Where(m => m.ReplyId == topicId);
        if (topicReply != null && topicReply.Count() > 0)
        {
            topicReplyList = topicReply.OrderByDescending(d=>d.AddTime).ToList();
        }


    }
}